package com.cmict.data.form.controller.admin;

import com.cmict.data.framework.common.pojo.CommonResult;
import com.cmict.data.form.api.service.SysEditionService;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.slf4j.Logger;
import org.slf4j.LoggerFactory;
import org.springframework.beans.factory.annotation.Value;
import org.springframework.validation.annotation.Validated;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PostMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;


/**
 * @author : qiaoyu
 * @description :
 * @create : 2022-9-2
 **/

@Api(tags = "后台管理-版本记录")
@RestController
@RequestMapping("/form/edition")
@RequiredArgsConstructor
@Validated
public class SysEditionController {
    private static final Logger logger = LoggerFactory.getLogger(SysEditionController.class);

	private final SysEditionService sysEditionService;


	@ApiOperation(value = "创建流程表单数据版本记录表")
	@GetMapping(value = "/dataVersionRecord")
	public CommonResult dataVersionRecord(String tableName) throws Exception{
			return CommonResult.success(sysEditionService.dataVersionRecord(tableName));
	}

    @ApiOperation(value = "获取流程表单数据记录表记录集合")
    @GetMapping(value = "/getDataVersionList")
    public CommonResult getDataVersionList(String tableName,Long id) throws Exception{
        return CommonResult.success(sysEditionService.getDataVersionList(tableName,id));
    }
    //删除 分页获取直接调用自定义表单的  "自定义查找数据列表"  接口获取
    //获取单条数据调用getDataOneId
    //获取最新数据getDataVersionList 第一条
}
